import { request } from '@/utils/request';

const Api = {
  captcha: '/open/v1/access/captcha',
  login: '/open/v1/access/sign_in',
  logout: '/open/v1/access/sign_out',
};

// 登录
export function login(data: any) {
  return request.post<any>({
    url: Api.login,
    data,
  });
}

// 登录
export function captcha(params?: any) {
  return request.get<any>({
    url: Api.captcha,
    params,
  });
}

// 登出
export function logout() {
  return request.post<any>({
    url: Api.logout,
  });
}

export default { login, captcha, logout };
